/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.general.dao;

import isd.general.modelo.GR_Provincia;
import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;

/**
 *
 * @author Claudio
 */
@Stateless
public class ProvinciaDAO extends BaseDAO {

    
    public List<GR_Provincia> getLista(){
        return queryList(GR_Provincia.class, "SELECT p FROM Provincia p ORDER BY p.nombre");
    }
    
    public GR_Provincia getProvincia(String codigo){
        return em.find(GR_Provincia.class,codigo);
    }

    public List<GR_Provincia> getProvinciaByNombre(String nombre) {
        return queryList(GR_Provincia.class, "SELECT p FROM Provincia p WHERE p.nombre = '"+nombre+"%'");
    }
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
 
}
